package core.domain.messages;

import javax.xml.bind.annotation.XmlRootElement;

import core.domain.Torrent;

@XmlRootElement
public class RegisterMessage extends AbstractMessage {
	/**
	 * 
	 */
	private static final long serialVersionUID = -6242342348924090377L;

	private Torrent torrent;
	
	private boolean duplicate = false;
	
	protected RegisterMessage() {
		super(MessageType.REG);
	}
	
	public RegisterMessage(Torrent torrent){
		this();
		this.torrent = torrent;
	}
	public Torrent getTorrent() {
		return torrent;
	}
	
	public void setTorrent(Torrent torrent) {
		this.torrent = torrent;
	}

	public boolean isDuplicate() {
		return duplicate;
	}
	
	public void setDuplicate(boolean duplicate) {
		this.duplicate = duplicate;
	}

	@Override
	public String toString() {
		return "RegisterMessage [torrent=" + torrent + ", duplicate=" + duplicate + "]" + " super: " + super.toString();
	}
	
}
